package com.csjy.migration.hnnd.workflow;

import com.csjy.migration.hnnd.BusinessTool;
import com.csjy.migration.hnnd.DbUtil;
import com.csjy.migration.hnnd.ProgramArgument;
import com.csjy.migration.hnnd.annotation.Task;
import com.csjy.migration.hnnd.business.SourceBusinessData;

import java.util.Map;


/*
  服务性代偿受理(item-accept-guoqiao-hny)
*/
public class ItemAcceptGuoqiaoHny extends WorkflowMigration{


    public ItemAcceptGuoqiaoHny(DbUtil sourceDbUtil, DbUtil targetDbUtil, SourceBusinessData sourceData, ProgramArgument programArgument, String projectId, String procInstId, Map procInstRow) throws Exception {
        super(sourceDbUtil, targetDbUtil, sourceData, programArgument, projectId, procInstId, procInstRow);
        this.customInitData();
    }

    @Override
    public void customInitData() throws Exception {
        this.curBizType = "zddcsl";
    }

    @Override
    public void customInsertOrUpdateData() throws Exception {

    }

    @Task("服务性代偿受理@项目经理提交申请")
    public void fwxxmjltjsq() throws Exception {
        this.curModelMap.put("提交办事处",new String[]{"task1535444097093tjbsc","提交办事处"});
        this.curModelMap.put("提交分公司",new String[]{"task1535444097093tjbsc","提交办事处"});

        this.curCustomData.put("creditTimeStart",this.getJbpmVarInstValueByName("old_auditTime"));

        this.curCustomData.put("applyTime", BusinessTool.convertApplyTimeToMonth(this.getJbpmVarInstValueByName("old_auditTerm")));
        this.curCustomData.put("creditTimeEnd",this.getJbpmVarInstValueByName("old_assumpTime"));
        this.curCustomData.put("extensionEnddate",this.getJbpmVarInstValueByName("EndDeferDate"));
        this.curCustomData.put("applyCoverage",this.getJbpmVarInstValueByName("old_currAssureSum"));
        this.curCustomData.put("compensatoryMoney",this.getJbpmVarInstValueByName("askUseGuoqiaoSum"));

        this.curAffixType = "sqbg";

        this.setCommonData(true,null);

    }

    @Task("服务性代偿受理@办事处负责人审核")
    public void fwxbscfzrsh() throws Exception {

        this.curModelMap.put("通过",new String[]{"task1535444131823tg","通过"});
        this.curModelMap.put("不通过",new String[]{"endbtg","不通过"});
        /*this.curModelMap.put("同意",new String[]{"",""});*/

        this.curAffixType = "tjfj";

        this.setCommonData(true,null);
    }

    @Task("服务性代偿受理@分公司负责人审核")
    public void fwxfgsfzrsh() throws Exception {
        this.curModelMap.put("通过",new String[]{"task1569398954208tg","通过"});
        this.curModelMap.put("不通过",new String[]{"endbtg","不通过"});
        this.curAffixType = "tjfj";

        this.setCommonData(true,null);


    }

    @Task("服务性代偿受理@公司融资部审批")
    public void fwxgsrzbsp() throws Exception {
        this.curModelMap.put("通过",new String[]{"task1535444263828tg","通过"});
        this.curModelMap.put("不通过",new String[]{"endbtg","不通过"});

        this.setCommonData(true,null);
    }

    @Task("服务性代偿受理@业务副总经理审批")
    public void fwxywfzjlsp() throws Exception {
        this.curModelMap.put("同意",new String[]{"endty","通过"});
        this.curModelMap.put("不同意",new String[]{"endbty","不通过"});

        this.curModelMap.put("通过",new String[]{"endty","通过"});
        this.curModelMap.put("不通过",new String[]{"endbty","不通过"});

        this.setCommonData(true,null);
    }

    @Task("主动代偿受理@项目经理提交申请")
    public void zdxmjltjsq() throws Exception {
        fwxxmjltjsq();
    }

    @Task("主动代偿受理@办事处负责人审核")
    public void zdbscfzrsh() throws Exception {
        fwxbscfzrsh();
    }

    @Task("主动代偿受理@分公司负责人审核")
    public void zdfgsfzrsh() throws Exception {
        fwxfgsfzrsh();
    }

    @Task("主动代偿受理@公司融资部审批")
    public void zdgsrzbsp() throws Exception {
        fwxgsrzbsp();
    }

    @Task("主动代偿受理@业务副总经理审批")
    public void zdywfzjlsp() throws Exception {
        fwxywfzjlsp();
    }

}
